A programmable logic controller (PLC) is a special form of computer-based controller typically employed to control equipment, machinery and/or instrumentation in automated industrial electromechanical processes. A common example of such an automated industrial electromechanical process is given by the operation of a factory assembly line. In the dynamic environment of a factory assembly line, there may be multiple pieces of industrial equipment, machinery and/or instrumentation (collectively referred to as “equipment” for simplicity) associated with the fabrication, assembly, and/or packaging of parts/components, as well as the transport of the parts/components amongst various stages of fabrication, assembly and/or packaging.
FIG. 1 provides a general illustration of the typical role of a conventional PLC 50 in connection with an automated industrial process 10 such as the operation of a factory assembly line. In addition to multiple pieces of equipment 20, the dynamic environment of a factory assembly line typically includes several control devices 30 (e.g., actuators) for operating the multiple pieces of equipment 20, as well as multiple input devices 40 (e.g., sensors) to provide indications of equipment status and/or various conditions associated with fabrication, assembly, packaging and/or transport of parts/components. Such indications provided by the input devices 40 often are referred to as “states” or “conditions” of the dynamic environment. Some examples of control devices 30 used to operate the equipment 20 include magnetic relays, solenoids, electric motors, and pneumatic or hydraulic cylinders. Some examples of input devices 40 include limit switches, position sensors, analog sensors (e.g., pressure or temperature sensors), and imaging devices (e.g., cameras).
Generally speaking, the PLC 50 is employed to monitor input signals 66 provided by input devices 40. These input signals, respectively or in various combinations, represent different states (conditions) of the dynamic environment as a function of time. In response to the input signals present at a given time, the PLC 50 generates output signals 68 to the control devices 30 for operating the industrial equipment 20, to ensure the automated process 10 is implemented efficiently and predictably. To this end, the PLC 50 generally is employed to coordinate predetermined sequences of actions to be taken by the equipment 20 implementing the process 10, in which respective actions may need to occur within a certain time window contingent on information provided by the input devices 40 (via the input signals 66).
A typical PLC includes programmable memory to store processor-executable instructions and employs various other electronic components to implement functions such as logic, sequencing, timing, counting, and arithmetic. In terms of general architecture and various aspects of functionality, PLCs are in many respects similar to general-purpose computers (e.g., desktop or laptop personal computers); however, whereas general-purpose computers typically are optimized for calculation and display tasks, PLCs generally are optimized for control tasks in a dynamic environment such as an automated industrial process. Accordingly, PLCs generally are thought of as special-purpose control computers for controlled dynamic environments. Since PLCs often are employed in the demanding conditions of an automated industrial process, from a package design standpoint conventional PLCs often tend to be ruggedly designed so as to withstand demanding environments in which the PLC may be exposed to one or more of physical vibrations, challenging temperature and humidity conditions, dust or potentially damaging materials, and electrically noisy environments.
FIG. 2 illustrates a generalized block diagram of the typical electrical components/circuitry (e.g., “hardware”) constituting the conventional PLC 50 of FIG. 1. As shown in FIG. 2, the basic functional components of the PLC 50 include a processor unit 52, memory 54, power supply 56, input interface 58, output interface 60, and one or more communications interfaces 62 all communicatively and/or electrically coupled to one another. FIG. 2 also shows a programming device 64 communicatively coupled to the PLC 50 and employed to program the PLC.
In FIG. 2, the processor unit 52 includes a microprocessor to interpret input signals 66 received by the input interface 58, and in turn provide output signals 68 via the output interface 60 so as to implement control actions according to a program (e.g., series of processor-executable instructions) stored in the memory 54. In particular, the memory 54 stores the program containing instructions representing the control actions to be implemented by the microprocessor, as well as various data relating to input signals, output signals and operation of the microprocessor as it carries out various instructions. The input interface 58 provides to the processor unit 52 information via input signals 66 received from external input devices (e.g., sensors, switches, meters, counters, etc.). The processor unit 52 in turn communicates control actions to external output devices (e.g., valves, motors, etc.) via the output signals 68.
In FIG. 2, examples of components constituting the respective input and output interfaces may include analog-to-digital converters, optocouplers/optoisolators, buffers, latches, and drivers so as to appropriately interface with various external input and output devices associated with the controlled dynamic environment. Although four input signals and four output signals are shown for purposes of illustration in FIG. 2, it should be appreciated that different types of conventionally available PLCs may be configured to accept different numbers of input signals (some number N of input signals) and provide different numbers of output signals (some number X of output signal), and that the number of input signals and output signals need not necessarily be the same. In general, the number N of input signals and the number X of output signals is dictated at least in part by the number of input devices 40 employed to monitor the automated process 10 of FIG. 1 and the number of control devices 30 employed to control the equipment 20.
In the PLC 50 shown in FIG. 2, the communications interface(s) 62 is/are used to receive and transmit various data (which may relate to one or more of the programs for execution by the processor unit 52, the input signals, the output signals, other data to be utilized by the processor unit 52 in executing the program, etc.) via one or more communication networks from or to one or more network-based external input/output devices and/or other remote PLCs. In general, the communications interface(s) 62 implement such functions as device verification, data acquisition, synchronization between user applications, and connection management. The power supply 56 converts AC voltage to a low DC voltage (e.g., 5 Volts) required for the various circuitry in the PLC to operate. Finally, the programming device 64 (which in some examples may be coupled to the PLC 50 via the communication interface(s) 62) is employed to enter into the memory 54 the program to be executed by the processing unit 52; typically, the program is developed/written in the programming device 64 and then transferred to the memory 54 of the PLC 50.
FIG. 3 provides additional details of the internal architecture of the PLC 50 shown in FIG. 2, particularly in connection with the processor unit, various elements of memory, input/output interfaces, and busses to facilitate information transfer. For example, FIG. 3 illustrates that the processor unit 52 (denoted as CPU in FIG. 2) is associated with a clock 52A, the frequency of which determines the operating speed of the PLC and provides the timing and synchronization for various elements in the PLC. Information within the PLC is carried amongst the processor unit, various memory elements, and to and from the input/output interfaces 58 and 60 via multiple busses; in particular, the PLC employs a data bus for transporting data to and from the PLC's constituent elements, an address bus to send the addresses of locations for accessing stored data, and a control bus for signals relating to internal control actions. The PLC architecture also may include an I/O system bus for communications between the input/output interfaces 58 and 60 (from which the input signals 66 are received from external input devices, and the output signals 68 are provided to external output devices, respectively) and an input/output unit 55 configured to transfer input/output information between the I/O system bus and the PLC's data bus.
In general, the processor unit 52 (CPU) of the architecture shown in FIG. 3 includes an arithmetic and logic unit (ALU) that is responsible for data manipulation and carrying out arithmetic operations (e.g., addition, subtraction, multiplication, division) and digital logic operations (e.g., AND, OR, NOT, and EXCLUSIVE-OR), internal memory registers used to store information involved in program execution, and an internal control unit to receive the output of the clock 52A and control the timing of operations. The various memory elements constituting memory 54 may include read-only-memory (ROM) 54A to provide permanent storage for the operating system and fixed data used by the processor unit, user program random-access memory 54B (User program RAM) employed for the program to be executed by the PLC, and data random-access memory 54C (Data RAM) used for data (information regarding the status of input and output signals, values of timers and counters and other internal devices, etc.). The program to be executed by the PLC may also be stored in non-volatile memory.
From the PLC architecture illustrated in FIG. 3, it may be appreciated that although conventional PLCs often are considered special-purpose computers rather than general-purpose computers, both PLCs and general-purpose computers share many aspects of a “Von Neumann” computer architecture. In a Von Neumann computer architecture, computer instructions (the “user program” stored in User program RAM 54A) as well as any data required for program execution (e.g., stored in Data RAM 54C) are accessed from various memory elements over a common bus architecture (i.e., via the address, data and control busses shown in FIG. 3). Although conventional PLCs attempt to tailor computer performance by being special-purpose computing devices implementing specific functionality corresponding to a particular automated industrial process, the architecture of conventional PLCs nonetheless places fundamental limits on their performance, as they execute instructions serially and hence effectively have no capacity for parallel execution.
Programming of a PLC primarily is concerned with specifying digital logic functions that process one or more input signals representing a sensed condition (“state”) associated with the automated process being implemented by various equipment at a given time. The digital logic functions acting on the monitored condition of the automated process generate one or more control signals in response to the monitored condition. As noted above, these control signals are applied to control devices that in turn control the various equipment to take some action involved in further implementing the automated process. At a high level, a PLC program generally implements a sequence of one or more actions in response to monitored conditions as a function of time (e.g., if A or B occurs, actuate C; if A and B occurs, actuate D). The automated process evolves over time as actuators control equipment to drive the process to new conditions. Hence, as noted above, the automated process constitutes a dynamic environment in which an evolution of conditions is monitored by the PLC, and wherein the PLC makes decisions and updates control signals to actuators, based on respective monitored conditions, to drive the environment to new conditions.
Many conventional PLCs are programmed via a “ladder logic” programming language to codify the digital logic that is used to evaluate inputs signals representing monitored conditions. Common ladder logic programming languages typically employ graphical diagrams that resemble “rungs” of a ladder, wherein respective rungs represent circuit diagrams for electromechanical relays (which were used in older logical control systems) to facilitate intuitive programming by control system engineers. Ladder logic is best suited to implement control solutions in which primarily binary variables are involved (e.g., the monitored conditions in a dynamic environment each may be represented as TRUE, i.e., logic one, or FALSE, i.e., logic zero).
However, in a variety of automated process environments, outputs of sensors may be analog signals. Accordingly, in some instances, if the direct output of a given input device/sensor is not in the form of a binary signal, the output of the input device/sensor may be pre-conditioned in some respects to provide the input signals 66 in binary form. For example, an analog output of a temperature sensing device may be first applied to a comparator circuit having a temperature set point voltage as another input so as to provide, as one of the input signals 66, a binary indication of whether or not the monitored temperature is above or below the particular temperature set point. Alternatively, an analog value may be converted to a quantitative value encoded into a multi-bit digital word used by the system to perform mathematical operations and/or make decisions. Similarly, a multi-bit output of a counter serving as an input device may be compared to a pre-determined count to in turn provide, as one of the input signals 66, a binary indication of whether or not the counter output is above or below the pre-determined count (alternatively, an output of a counter having some number B of bits may be provided directly as a number B of input signals 66). Yet other types of input devices may generate highly transient signals; for such devices, a latch may be employed to facilitate the detection of a signal edge or transient so as to provide an input signal of suitable duration to the PLC indicating the occurrence of the edge/transient. In other examples, input devices may include various networked devices, for which one or more communication status signals (e.g., data packet transmitted/received) may serve as one of the input signals 66.
Ladder logic and other languages for programming conventional PLCs generally are considered to be rules-based programming languages. A typical PLC program may be constituted by a series of rules, wherein each rule is constituted by one or more binary input signals (e.g., A, B, C, D) representing a monitored condition of the automated process, and a corresponding control signal (e.g., X) that is generated in response to particular digital logic evaluating the input signals. Accordingly, in some aspects a rule in a PLC program may be viewed in a manner similar to an “IF/THEN” statement (e.g., If (A AND NOT B) AND (C OR D), THEN X). The PLC program includes all of the rules necessary to implement all of the actions that are required in response to different combinations of input signals representing all of the different possible conditions of the automated process that may be monitored via the set of available input signals.
With reference again to FIG. 2, the programming device 64 (which may be a handheld programming device, a desktop console, or a personal computer such as a laptop or tablet computer) is typically employed to create, store and download to the PLC executable programs including a set of rules. When the program is executed by the PLC, the rules are typically executed sequentially from first to last and then repeated, wherein each pass through the set of rules in sequence often is referred to as a “scan” or “control loop.” Thus, consecutive repetitions of the scan or control loop represent a continuous cycle of the PLC reading input signals, examining input signal using the logic encoded in the program rules, and then changing control signals output by the PLC as appropriate.
More specifically, with respect to general operation, including various housekeeping activities and performing scans or control loops, conventional PLCs typically function in a cyclical manner. For example, when power is initially applied to a PLC, the PLC may perform a self-check or diagnostic routine to ensure that various hardware components are functioning properly. With reference again to FIGS. 2 and 3, if no fault or error conditions are detected, the PLC then controls the input interface 58 and memory 54 so as to read each of the input signals 66 sequentially and store each read instance of a given input signal in a dedicated memory location. The PLC then executes its program by sequentially testing each rule (i.e., fetching, decoding and executing the program instructions in sequence) and solving the logic encoded in the rule.
In particular, for each rule, the stored instances of certain input signals as specified in the rule are retrieved from memory, the rule is evaluated based on the retrieved input signals, and if the rule is satisfied (i.e., all of the pre-requisite conditions specified in the rule are met), a control signal corresponding to the satisfaction of the rule is generated. If such a control signal is generated, it is stored in a dedicated memory location. Evaluation of a given rule may involve multiple read operations from, and write operations to, different memory locations (e.g., registers) as the digital logic codified in the rule is solved. As noted above, respective rules are evaluated sequentially as the PLC executes the ladder logic program; accordingly, while the PLC is evaluating a particular rule, it is inattentive to the other rules codified in the program.
If the PLC generates any control signals in response to evaluation of the rules, it may provide these for output as a set of updated control signals 68. These control signals in turn are transmitted to one or more actuators or other equipment to be controlled in connection with the automated process. The PLC then returns to performing the self-check, reading each of the input signals and storing them to memory, executing the program rules to complete the control loop, updating the control signals for output (if any), and repeating this cycle iteratively.
The time period required by the PLC to complete the cycle described above commonly is referred to as a “cycle time” or “scan time.” Typical cycle times of conventional PLCs are on the order of approximately 10 milliseconds to hundreds of milliseconds. The cycle time generally is determined by the particular CPU used in the processor unit, the size of the program to be scanned (e.g., the number of rules constituting the program, which in turn depends at least in part on the number of input signals to be read, the number of input signal combinations for which independent evaluations are required, and the number of control signals to be generated), and the system functions that are in use pursuant to execution of the program. Thus, the more complex the program, the longer the cycle time will be.
It should be appreciated that, in a conventional PLC, the vast majority of rules when evaluated in a given cycle are not satisfied (i.e., no control signal is generated pursuant to evaluation of the rule); if a rule is not satisfied, the program merely moves to the next rule for evaluation. In this manner, it is common in conventional PLCs for a substantial portion of a given cycle to be spent evaluating successive rules without generating any control signals.
Although relatively quick compared to general-purpose computers programmed to implement similar functionality, the cycle time of a PLC is not instantaneous. As a result, the PLC does not “watch” its input signals all of the time, but instead the PLC samples the states of the input signals periodically depending on the cycle time. Furthermore, the cycle time constitutes a minimum delay in updating control signals (if generated pursuant to a satisfied rule) that are output by the PLC in response to sampled input signals. In this manner, the cycle time also may be viewed as a minimum response time (a “reaction time”) of the PLC to a particular monitored condition (i.e., represented by a particular value for one or more of the input signals), and is often referred to as a “latency” of the PLC. Thus, it should be appreciated that due to this latency, an input signal that lasts for a duration shorter than the cycle time may be missed by the program (in general, any input signal must be present for longer than the cycle time). In some instances, external circuitry may be employed to latch transient signals so that they will not be missed entirely by the PLC. Even if a particular input signal is not “missed” due to latching, however, a control signal that is to be generated in response to the input signal may be generated by the PLC too late to be effective for the correct operation of the equipment being controlled.
Because of the cyclical nature in which a conventional PLC executes a program, all possible combinations of input signals (representing all possible conditions of the automated process being controlled for which some action is required) must be contemplated in a single control loop of the program. Stated differently, as noted above, as long as a monitored condition represented by one or more input signals is in some manner involved in causing some action to occur (via one or more control signals) at some point during the duration of an automated process, there needs to be one or more rules in the program that evaluate the particular monitored condition. As noted above, the latency of a conventional PLC scales with program complexity; hence, as the number of possible conditions of the process for which actions are required increases, the program becomes larger and the latency becomes greater. Furthermore, in many automated processes, some conditions occur more frequently than others, and in some instances conditions that may occur rarely may be associated with a rule representing complicated logic that needs to be evaluated (which requires more processing time). Accordingly, significant portions of the cycle time may be “used up” (and latency exacerbated) by executing one or more rules to evaluate one or more monitored conditions that occur rarely.